/*
* @Author: Someu
* @Date:   2017-12-03 21:42:00
* @Last Modified by:   Someu
* @Last Modified time: 2017-12-04 09:21:08
*/
require('./index.css');
require('page/common/nav/index.js');
require('page/common/header/index.js');
require('page/common/nav-side/index.js');
require('page/common/index.js');
require('page/index/index.css');

var templateIndex   = require('./index.string');
var _user           = require('service/user-service.js');
var _mm             = require('util/mm.js');
var navSide         = require('page/common/nav-side/index.js');

var page = {    
    init : function(){
        this.onLoad();
    },
    onLoad : function(){
        navSide.init({
            name : 'user-center'
        });
        this.loadUserInfo();
    },
    loadUserInfo : function(){
        $('.panel-body').html('<div class="loading"></div>');
        var userHtml = '';
        /*_user.getUserInfo(function(res){
            userHtml = _mm.renderHtml(templateIndex,res);
            $('.panel-body').html(userHtml);
        },function(errMsg){
            _mm.errorTips(errMsg);
        }) */
        var resTest = {
            user    : '张三',
            phone   : '13112341234',
            email   : 'zhangsan@test.com',
            question: '我？',
            answer  : '张三'
        };
        userHtml = _mm.renderHtml(templateIndex,resTest);
        $('.panel-body').html(userHtml);

    }
};

$(function(){
    page.init();
});